/*
 * Lab7A.cpp
 *
 *  Created on: Mar 25, 2014
 *      Author: Anthony Varghese
 */

#include <iostream>
#include <string>
using std::string;
using std::ostream;

#include "Data.h"
using lab7::Data;

using std::cout;
using std::endl;

#include <cstdlib> // for rand and RAND_MAX

int main(void){
	cout << "CSIS 237 Lab 7 - Linked Lists" << endl;

	const int DATASIZE = 4;
	const double HALF_RAND_MAX = RAND_MAX / 2;
	const double SCALE_FACTOR = 1e-6;

	Data store1;

	cout << "1. Generating data ... " << endl;
	for (int i=0; i<DATASIZE; i++){
		short  x = rand() % 1000;
		double y = ( rand() - HALF_RAND_MAX ) * SCALE_FACTOR;
		store1.insert( x, y );
	}
	cout << store1;
	cout << " done!" << endl << endl;


	// Make a copy and print the copy
	cout << "2. Making a copy:" << endl;
	{
		Data store2;
		store2 = store1;
		cout << store2;
	}
	cout << endl;

	// Make another copy and print the copy
	cout << "3. Making a second copy:" << endl;
	{
		Data store3( store1 );
		cout << store3;
	}
	cout << endl;

	cout << "4. Original data:" << endl;
	cout << store1;
	cout << "... all done!" << endl;
}
